package com.darksider.darkotlin.net.module

import dagger.Module
import dagger.Provides
import okhttp3.Cache
import java.io.File
import javax.inject.Singleton

/**
 * User: yaodong(1126220529@qq.com)
 * Date: 2017-05-26
 * Time: 11:43
 * Description:缓存依赖模块
 * Update:
 */
@Module
class CacheModule {

    companion object {
        //缓存目录
        const val CACHE_DIR = "./cache"
        //缓存大小
        const val CACHE_SIZE = 10 * 1024 * 1024L
    }

    @Singleton @Provides fun cache(): Cache = Cache(File(CACHE_DIR), CACHE_SIZE)

}